package test;

public class factorial {
    public static void main(String[] args) {
        System.out.println(process(2,10));
    }
    public static int process(int a,int n){
        if (n==0){
            return 1;
        }
        if (n==1){
            return a;
        }
        int left = n/2;
        int right = n-n/2;
       int leftNum = process(a,left);
       int rightNum = process(a,right);
        return leftNum*rightNum;
    }
}
